package com.lyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyun.mapper.VideoConcernMapper;
import com.lyun.pojo.VideoConcern;
import com.lyun.service.VideoConcernService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

@DubboService
public class VideoConcernServiceImpl extends ServiceImpl<VideoConcernMapper, VideoConcern> implements VideoConcernService {

    @Resource
    private VideoConcernMapper videoConcernMapper;

    @Override
    public void saveVideoConcern(Long selfId, Long userId) {
        VideoConcern videoConcern = new VideoConcern();
        videoConcern.setUserId(userId);
        videoConcern.setSelfId(selfId);
        videoConcernMapper.insert(videoConcern);
    }

    @Override
    public void removeByUserIdAndSelfId(Long selfId, Long userId) {

    }

    @Override
    public boolean getAlreadyConcernBySelfIdAndUserId(Long selfId, Long userId) {
        return false;
    }

    /**
     * 获取selfId和ids中的关注关系。
     *
     * @param selfId
     * @param ids
     * @return
     */
    @Override
    public Set<Long> getVideoConcernByUserIdWithAuthorId(Long selfId, List<Long> ids) {
        return videoConcernMapper.selectConcernByUserIds(selfId, ids);
    }
}
